module('static');

test('ADT.formatDigits', function() {
  expect(6);

  equals(
    ADT.formatDigits(0, 2),
    '00',
    'ADT.formatDigits(0, 2)');

  equals(
    ADT.formatDigits(1, 2),
    '01',
    'ADT.formatDigits(1, 2)');

  equals(
    ADT.formatDigits(10, 2),
    '10',
    'ADT.formatDigits(10, 2)');

  equals(
    ADT.formatDigits(1, 2, ' '),
    ' 1',
    'ADT.formatDigits(1, 2, \' \')');

  equals(
    ADT.formatDigits(1, 10),
    '0000000001',
    'ADT.formatDigits(1, 10)');

  equals(
    ADT.formatDigits(12345, 2),
    '12345',
    'ADT.formatDigits(12345, 2)');
});

test('ADT.isLeapYear', function() {
  expect(4);

  equals(
    ADT.isLeapYear(1600),
    true,
    'ADT.isLeapYear(1600)');

  equals(
    ADT.isLeapYear(1900),
    false,
    'ADT.isLeapYear(1900)');

  equals(ADT.isLeapYear(1904),
    true,
    'ADT.isLeapYear(1904)');

  equals(
    ADT.isLeapYear(1905),
    false,
    'ADT.isLeapYear(1905)');
});

test('ADT.getDaysInMonth', function() {
  expect(24);
  
  equals(
    ADT.getDaysInMonth(1900, 1),
    31,
    'ADT.getDaysInMonth(1900, 1)');

  equals(
    ADT.getDaysInMonth(1900, 2),
    28,
    'ADT.getDaysInMonth(1900, 2)');

  equals(
    ADT.getDaysInMonth(1900, 3),
    31,
    'ADT.getDaysInMonth(1900, 3)');

  equals(
    ADT.getDaysInMonth(1900, 4),
    30,
    'ADT.getDaysInMonth(1900, 4)');

  equals(
    ADT.getDaysInMonth(1900, 5),
    31,
    'ADT.getDaysInMonth(1900, 5)');

  equals(
    ADT.getDaysInMonth(1900, 6),
    30,
    'ADT.getDaysInMonth(1900, 6)');

  equals(
    ADT.getDaysInMonth(1900, 7),
    31,
    'ADT.getDaysInMonth(1900, 7)');

  equals(
    ADT.getDaysInMonth(1900, 8),
    31,
    'ADT.getDaysInMonth(1900, 8)');

  equals(
    ADT.getDaysInMonth(1900, 9),
    30,
    'ADT.getDaysInMonth(1900, 9)');

  equals(
    ADT.getDaysInMonth(1900, 10),
    31,
    'ADT.getDaysInMonth(1900, 10)');

  equals(
    ADT.getDaysInMonth(1900, 11),
    30,
    'ADT.getDaysInMonth(1900, 11)');

  equals(
    ADT.getDaysInMonth(1900, 12),
    31,
    'ADT.getDaysInMonth(1900, 12)');

  equals(
    ADT.getDaysInMonth(1904, 1),
    31,
    'ADT.getDaysInMonth(1904, 1)');

  equals(
    ADT.getDaysInMonth(1904, 2),
    29,
    'ADT.getDaysInMonth(1904, 2)');

  equals(
    ADT.getDaysInMonth(1904, 3),
    31,
    'ADT.getDaysInMonth(1904, 3)');

  equals(
    ADT.getDaysInMonth(1904, 4),
    30,
    'ADT.getDaysInMonth(1904, 4)');

  equals(
    ADT.getDaysInMonth(1904, 5),
    31,
    'ADT.getDaysInMonth(1904, 5)');

  equals(
    ADT.getDaysInMonth(1904, 6),
    30,
    'ADT.getDaysInMonth(1904, 6)');

  equals(
    ADT.getDaysInMonth(1904, 7),
    31,
    'ADT.getDaysInMonth(1904, 7)');

  equals(
    ADT.getDaysInMonth(1904, 8),
    31,
    'ADT.getDaysInMonth(1904, 8)');

  equals(
    ADT.getDaysInMonth(1904, 9),
    30,
    'ADT.getDaysInMonth(1904, 9)');

  equals(
    ADT.getDaysInMonth(1904, 10),
    31,
    'ADT.getDaysInMonth(1904, 10)');

  equals(
    ADT.getDaysInMonth(1904, 11),
    30,
    'ADT.getDaysInMonth(1904, 11)');

  equals(
    ADT.getDaysInMonth(1904, 12),
    31,
    'ADT.getDaysInMonth(1904, 12)');
});

test('ADT.getDaysInYear', function() {
  expect(2);

  equals(
    ADT.getDaysInYear(1900),
    365,
    'ADT.getDaysInYear(1900)');

  equals(
    ADT.getDaysInYear(1904),
    366,
    'ADT.getDaysInYear(1904)');
});

test('ADT.getLocalTZOffset', function() {
  expect(1);

  equals(
    ADT.getLocalTZOffset(),
    -((new Date()).getTimezoneOffset() * 60),
    'ADT.getLocalTZOffset()');
});
